# RUN: llc %s -mtriple=m68k -start-after=prologepilog -O0 -filetype=obj -o - \
# RUN:   | extract-section .text \
# RUN:   | FileCheck %s -check-prefixes=MOV8DK,MOV32RK,MOV8DQ,MOV32RQ,MOV8DF,MOV32RF
# RUN: llc %s -mtriple=m68k -start-after=prologepilog -O0 -filetype=obj -o - \
# RUN:   | extract-section .text \
# RUN:   | FileCheck %s -check-prefixes=MOV8DP,MOV32RP,MOV8DJ,MOV32RJ,MOV8DO,MOV32RO
# RUN: llc %s -mtriple=m68k -start-after=prologepilog -O0 -filetype=obj -o - \
# RUN:   | extract-section .text \
# RUN:   | FileCheck %s -check-prefixes=MOV8DE,MOV32RE,MOV8DB,MOV32RB

#------------------------------------------------------------------------------
# MxMove_RM is used for moving data from memory to register
#------------------------------------------------------------------------------

--- # PCI
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8DK:        0   0   0   1   0   0   0   0 . 0   0   1   1   1   0   1   1
# MOV8DK-SAME:   0   0   0   1   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV8DK-SAME:   0   0   0   1   0   0   0   0 . 0   0   1   1   1   0   1   1
# MOV8DK-SAME:   0   0   0   1   1   0   0   0 . 1   1   1   1   1   1   1   1
#               ---------------------------------------------------------------
# MOV32RK-SAME:  0   0   1   0   0   0   0   0 . 0   0   1   1   1   0   1   1
# MOV32RK-SAME:  0   0   0   1   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32RK-SAME:  0   0   1   0   0   0   1   0 . 0   0   1   1   1   0   1   1
# MOV32RK-SAME:  1   0   1   0   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---+-----------+---+-------+---+-------------------------------
#        BRIEF  DA |    REG    | L | SCALE | 0 |          DISPLACEMENT
#               ---+-----------+---+-------+---+-------------------------------
name: MxMove_RM_PCI
body: |
  bb.0:
    $bd0 = MOV8dk  0,  $d1, implicit-def $ccr
    $bd0 = MOV8dk  -1, $d1, implicit-def $ccr
     $d0 = MOV32rk 0,  $d1, implicit-def $ccr
     $d1 = MOV32rk 0,  $a2, implicit-def $ccr

...
--- # PCD
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8DQ-SAME:   0   0   0   1   0   0   0   0 . 0   0   1   1   1   0   1   0
# MOV8DQ-SAME:   0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32RQ-SAME:  0   0   1   0   0   0   0   0 . 0   0   1   1   1   0   1   0
# MOV32RQ-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
#               ---------------------------------------------------------------
# MOV32RQ-SAME:  0   0   1   0   0   0   0   0 . 0   1   1   1   1   0   1   0
# MOV32RQ-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
name: MxMove_RM_PCD
body: |
  bb.0:
    $bd0 = MOV8dq  0,  implicit-def $ccr
     $d0 = MOV32rq -1, implicit-def $ccr
     $a0 = MOV32rq -1, implicit-def $ccr

...
--- # ARII
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8DF:        0   0   0   1   0   0   0   0 . 0   0   1   1   0   0   0   0
# MOV8DF-SAME:   0   0   0   1   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV8DF-SAME:   0   0   0   1   0   0   0   0 . 0   0   1   1   0   0   0   0
# MOV8DF-SAME:   0   0   0   1   1   0   0   0 . 1   1   1   1   1   1   1   1
#               ---------------------------------------------------------------
# MOV32RF-SAME:  0   0   1   0   0   0   0   0 . 0   0   1   1   0   0   0   1
# MOV32RF-SAME:  0   0   0   1   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32RF-SAME:  0   0   1   0   0   0   1   0 . 0   0   1   1   0   0   1   0
# MOV32RF-SAME:  1   0   1   0   1   0   0   0 . 0   0   0   0   0   0   0   0
#               ---+-----------+---+-------+---+-------------------------------
#        BRIEF  DA |    REG    | L | SCALE | 0 |          DISPLACEMENT
#               ---+-----------+---+-------+---+-------------------------------
name: MxMove_RM_ARII
body: |
  bb.0:
    $bd0 = MOV8df  0,  $a0, $d1, implicit-def $ccr
    $bd0 = MOV8df  -1, $a0, $d1, implicit-def $ccr
     $d0 = MOV32rf 0,  $a1, $d1, implicit-def $ccr
     $d1 = MOV32rf 0,  $a2, $a2, implicit-def $ccr

...
--- # ARID
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8DP:        0   0   0   1   0   0   0   0 . 0   0   1   0   1   0   0   0
# MOV8DP-SAME:   0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32RP-SAME:  0   0   1   0   0   0   0   0 . 0   0   1   0   1   0   0   1
# MOV32RP-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
#               ---------------------------------------------------------------
# MOV32RP-SAME:  0   0   1   0   0   0   0   0 . 0   1   1   0   1   0   0   1
# MOV32RP-SAME:  1   1   1   1   1   1   1   1 . 1   1   1   1   1   1   1   1
name: MxMove_RM_ARID
body: |
  bb.0:
    $bd0 = MOV8dp  0,  $a0, implicit-def $ccr
     $d0 = MOV32rp -1, $a1, implicit-def $ccr
     $a0 = MOV32rp -1, $a1, implicit-def $ccr

...
--- # ARIPD
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8DE:        0   0   0   1   0   0   0   0 . 0   0   1   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32RE-SAME:  0   0   1   0   0   1   1   0 . 0   0   1   0   0   0   0   1
#               ---------------------------------------------------------------
# MOV32RE-SAME:  0   0   1   0   1   0   0   0 . 0   1   1   0   0   0   0   1
name: MxMove_RM_ARIPD
body: |
  bb.0:
    $bd0 = MOV8de  $a0, implicit-def $ccr
     $d3 = MOV32re $a1, implicit-def $ccr
     $a4 = MOV32re $a1, implicit-def $ccr

...
--- # ARIPI
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8DO-SAME:   0   0   0   1   0   0   0   0 . 0   0   0   1   1   0   0   0
#               ---------------------------------------------------------------
# MOV32RO-SAME:  0   0   1   0   0   1   1   0 . 0   0   0   1   1   0   0   1
#               ---------------------------------------------------------------
# MOV32RO-SAME:  0   0   1   0   1   0   0   0 . 0   1   0   1   1   0   0   1
name: MxMove_RM_ARIPI
body: |
  bb.0:
    $bd0 = MOV8do  $a0, implicit-def $ccr
     $d3 = MOV32ro $a1, implicit-def $ccr
     $a4 = MOV32ro $a1, implicit-def $ccr

...
--- # ARI
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8DJ-SAME:   0   0   0   1   0   0   0   0 . 0   0   0   1   0   0   0   0
#               ---------------------------------------------------------------
# MOV32RJ-SAME:  0   0   1   0   0   1   1   0 . 0   0   0   1   0   0   0   1
#               ---------------------------------------------------------------
# MOV32RJ-SAME:  0   0   1   0   1   0   0   0 . 0   1   0   1   0   0   0   1
name: MxMove_RM_ARI
body: |
  bb.0:
    $bd0 = MOV8dj  $a0, implicit-def $ccr
     $d3 = MOV32rj $a1, implicit-def $ccr
     $a4 = MOV32rj $a1, implicit-def $ccr

...
--- # ABS
#               ---------------------------+-----------+-----------+-----------
#                F   E | D   C | B   A   9 | 8   7   6 | 5   4   3 | 2   1   0
#               -------+-------+-----------+-----------+-----------+-----------
#                      |       |      DESTINATION      |         SOURCE
#                0   0 | SIZE  |    REG    |    MODE   |    MODE   |    REG
#               -------+-------+-----------+-----------+-----------+-----------
# MOV8DB-SAME:   0   0   0   1   0   0   0   0 . 0   0   1   1   1   0   0   1
# MOV8DB-SAME:   0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32RB-SAME:  0   0   1   0   0   1   1   0 . 0   0   1   1   1   0   0   1
# MOV32RB-SAME:  0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
# MOV32RB-SAME:  0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
#               ---------------------------------------------------------------
# MOV32RB-SAME:  0   0   1   0   1   0   0   0 . 0   1   1   1   1   0   0   1
# MOV32RB-SAME:  0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
# MOV32RB-SAME:  0   0   0   0   0   0   0   0 . 0   0   0   0   0   0   0   0
name: MxMove_RM_ABS
body: |
  bb.0:
    $bd0 = MOV8db  0, implicit-def $ccr
     $d3 = MOV32rb 0, implicit-def $ccr
     $a4 = MOV32rb 0, implicit-def $ccr

...
